-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid reinstalling installonly packages marked for ERASE #850
Avoid reinstalling installonly packages marked for ERASE #850
Conversation
6a29ae2
to
f4f3363
Compare
Back-ported tests: rpm-software-management/ci-dnf-stack#1392 |
libdnf5/rpm/solv/goal_private.cpp
Outdated
@@ -270,6 +284,7 @@ bool GoalPrivate::limit_installonly_packages(libdnf5::solv::IdQueue & job, Id ru | |||
|
|||
const InstallonlyCmpData installonly_cmp_data{spool, running_kernel}; | |||
q.sort(&installonly_cmp, &installonly_cmp_data); | |||
std::sort(available_unused_providers.begin(), available_unused_providers.end(), nevra_solvable_cmp_key); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I am not mistaken, the original patch for libdnf uses name cmp key and not nevra for both - sorting and lower_bound. May I ask you why is there a different implementation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right, I forgot about that.
I think I added that just because nevra_solvable_cmp_key
is already implemented.
I can add a new function to compare just the names if you prefer that?
The arch
and evr
sorting is not needed here so it would be more efficient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes sorting using only name will be more efficient, but sorting by NEVRA is not wrong. Please feel free to implement it according to your preferences.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I have added the new comparator for names only.
I have also rebased the PR.
Without this patch reinstalling installonly pkg marked for ERASE might be a valid smallest solution to our job. For example when user wants to install through a provide we select all packages that provide it and put them inside a `job install oneof ...` if one of the providers is also marked for ERASE due to installonly limit libsolv might decide to reinstall it. To make sure it doesn't happen mark the available package also as ERASE. openSUSE/libsolv#540 https://bugzilla.redhat.com/show_bug.cgi?id=2163474 https://issues.redhat.com/browse/RHEL-1253
f4f3363
to
8f878ac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
dab978c
openSUSE/libsolv#540
https://bugzilla.redhat.com/show_bug.cgi?id=2163474
https://issues.redhat.com/browse/RHEL-1253